/*
 *
 * Copyright (c) 2023 - future
 * @author fzh
 * @email e_341877120_mail@163.com
 * @link https://mvnrepository.com/search?q=io.github.xrfzh.cn
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package cn.xrfzh.system;

import cn.xrfzh.common.annotation.EnableXrSaTokenBootLog;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@Slf4j
@EnableXrSaTokenBootLog
@EnableScheduling
@EnableAsync
@ComponentScan(
		basePackages = { "cn.xrfzh.system", "cn.xrfzh.log", "cn.xrfzh.file", "cn.xrfzh.generator", "cn.xrfzh.biz" })
@MapperScan(basePackages = { "cn.xrfzh.system.mapper", "cn.xrfzh.log.mapper", "cn.xrfzh.file.mapper",
		"cn.xrfzh.generator.mapper", "cn.xrfzh.biz.**.mapper" })
@SpringBootApplication
public class SaTokenBootSystem implements CommandLineRunner {

	@Value("${server.port}")
	private String port;

	@Value("${server.servlet.context-path}")
	private String contextPath;

	public static void main(String[] args) {
		SpringApplication.run(SaTokenBootSystem.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		log.warn("在线接口文档地址：http://127.0.0.1:{}{}/doc.html", port, contextPath);
	}

}
